<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ include file="/admin/commons/taglib.jsp"%>
<%
    String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>后台管理</title>
    <s:include value="/layouts/kindEditor.jsp"></s:include>
    <script type="text/javascript">
        $(function(){
            $("#timu").addClass("active");
            $("#timu").find("ul li").eq(2).addClass("active");
        })
    </script>
</head>
<body>
    <div class="admin">
        <div class="panel">
            <div class="panel-head"><strong>添加试题</strong></div>
            <div class="panel-body">
                <form action="timu!save.action" id="form" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="timu.id" value="${timu.id}"/>
                   
                    <div class="form-group">
                        <div class="label"><label >试题分类</label></div>
                        <select  class="border radius" style="width:100%;height:35px;"  name="timu.type">
                            <option value="1">首测试题</option>
                            <option value="2" <s:if test="timu.type==2">selected="selected"</s:if>>周测试题</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <div class="label"><label >题目类型</label></div>
                        <select  class="border radius" style="width:100%;height:35px;"  name="timu.questionType">
                            <option value="1">听力选择题</option>
                            <option value="2" <s:if test="timu.questionType==2">selected="selected"</s:if>>阅读选择题</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <div class="label"><label >标题</label></div>
                        <div class="field">
                            <input type="text" class="input"  name="timu.question" size="50" placeholder="请输入标题"
                                   data-validate="required:请输入问题" value="${timu.question}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="label"><label >选项</label></div>
                        <% List<String> contents = (List<String>)request.getAttribute("optionContent");%>
                        <div class="field" style="width: 49.5%;float: left;">
                            <input type="text" class="input"  name="optionContent" size="50" placeholder="请输入A选项"
                                   data-validate="required:请输入A选项" value="<%=contents==null?"":contents.get(0)%>"/>
                        </div>
                        <div class="field" style="width: 49.5%;float: left;margin-left: 1%">
                            <input type="text" class="input"  name="optionContent" size="50" placeholder="请输入B选项"
                                   data-validate="required:请输入D选项" value="<%=contents==null?"":contents.get(1)%>"/>
                        </div>
                        <div style="clear: both"></div></br>
                        <div class="field" style="width: 49.5%;float: left;">
                            <input type="text" class="input"  name="optionContent" size="50" placeholder="请输入C选项"
                                   data-validate="required:请输入C选项" value="<%=contents==null?"":contents.get(2)%>"/>
                        </div>
                        <div class="field" style="width: 49.5%;float: left;margin-left: 1%">
                            <input type="text" class="input"  name="optionContent" size="50" placeholder="请输入D选项"
                                   data-validate="required:请输入D选项" value="<%=contents==null?"":contents.get(3)%>"/>
                        </div>
                    </div>

                    <div style="clear: both"></div></br>
                    <div class="form-group">
                        <div class="label"><label >正确答案</label></div>
                        <div class="field">
                            <input type="text" class="input" name="timu.answer" size="50" placeholder="请输入答案"
                                   data-validate="required:请输入答案" value="${timu.answer}"/>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="label"><label >语音材料</label></div>
                        <div class="field">
                            <a class="button input-file" href="javascript:void(0);">+ 浏览文件<input size="100" type="file"
                                  name="file" data-validate="required:请选择上传文件,regexp#.+.(mp3)$:只能上传mp3格式文件"/></a>
                        </div>
                    </div>

                    <button class="button bg-blue" onclick="return checkForm()">提交</button>
                </form>
            </div>
        </div>
    </div>


</body>
</html>

